package com.smart.seven.aop.advice.throwsadvice;

import com.smart.seven.aop.advice.Waiter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.SQLException;

/**
 * 测试类
 *
 * @author junrui.wang
 * @create 2018/6/14
 */
public class Test {
    public static void main(String[] args) throws SQLException {
        ApplicationContext ac = new ClassPathXmlApplicationContext("classpath*:com/smart/seven/aop/advice/throwsadvice/beans.xml");
        ForumService service = (ForumService) ac.getBean("forumService");
        try {
            service.removeForum();
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            service.updateForum();
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
